package com.codegeek.project.slope.domain;

import com.codegeek.common.utils.ReplaceIllegalChar;
import com.codegeek.framework.aspectj.lang.annotation.Excel;
import com.codegeek.framework.web.domain.BaseEntity;
import lombok.Data;

import java.util.Date;

/**
 * 摄像头对象 slope_camera
 *
 * @author codegeek
 * @date 2020-02-17
 */
@Data
public class SlopeCamera extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    private Long cameraId;

    /**
     * 直播流地址
     */
    @Excel(name = "直播流地址")
    private String rtmpUrl;

    /**
     * HLS流地址
     */
    @Excel(name = "HLS流地址")
    private String hlsUrl;

    /**
     * token
     */
    @Excel(name = "token")
    private String accessToken;

    /**
     * token时间
     */
    @Excel(name = "token时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date tokenTime;

    /**
     * nvrID
     */
    @Excel(name = "nvrID")
    private Long nvrId;

    /**
     * nvr
     */
    private SlopeNvr nvr;

    /**
     * 通道号
     */
    @Excel(name = "通道号")
    private Long channel;

    /**
     * 激活码
     */
    @Excel(name = "激活码")
    private String validateCode;

    /**
     * 摄像头类型
     */
    @Excel(name = "摄像头类型")
    private Integer cameraType;

    @Excel(name = "设备ID")
    private Long deviceId;

    private SlopeDevice device;

    public void setRtmpUrl(String rtmpUrl) {
        this.rtmpUrl = new ReplaceIllegalChar().replace(rtmpUrl);
    }

    public void setHlsUrl(String hlsUrl) {
        this.hlsUrl = new ReplaceIllegalChar().replace(hlsUrl);
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = new ReplaceIllegalChar().replace(accessToken);
    }

    public void setValidateCode(String validateCode) {
        this.validateCode = new ReplaceIllegalChar().replace(validateCode);
    }
}
